package co.baiku.boot.message;

import java.util.Map;

/**
 * 微信公众号消息
 */
public class WeixinPublicMessage {
    private String fromUserName;
    private String toUserName;
    private String msgType;//消息类型:text、image、voice、video、shortvideo(小视频)、location(地理位置)、link(连接消息)
    private String content;//
    private String event;//msgType为event时：subscribe(订阅)、unsubscribe(取消订阅)、SCAN（扫码）、LOCATION（上报地理位置）、CLICK（自定义菜单事件）、VIEW（点击菜单跳转链接时的事件）
    private String eventKey;//扫描二维码时(subscribe):事件KEY值，qrscene_为前缀，后面为二维码的参数值;用户已关注时(SCAN):事件KEY值，是一个32位无符号整数，即创建二维码时的二维码scene_id
    private String ticket;//二维码的ticket，可用来换取二维码图片
    //Event为LOCATION时:
    private String createTime;
    private String latitude;//地理位置纬度
    private String longitude;//地理位置经度
    private String precision;//地理位置精度

    //Event为TEMPLATESENDJOBFINISH时:
    private String msgID;//消息id
    private String status;//发送状态,用户拒绝接收(failed:user block),发送成功(success)

    public WeixinPublicMessage() {

    }

    public WeixinPublicMessage(Map<String, String> map) {
        this.fromUserName = map.get("FromUserName");//消息来源用户标识
        this.toUserName = map.get("ToUserName");//消息目的用户标识
        this.msgType = map.get("MsgType");//消息类型
        this.content = map.get("Content");//消息内容
        this.event = map.get("Event");
        this.eventKey = map.get("EventKey");
        this.ticket = map.get("Ticket");
        this.createTime = map.get("CreateTime");//消息创建时间 （整型）
        this.latitude = map.get("Latitude");//地理位置纬度
        this.longitude = map.get("Longitude");//地理位置经度
        this.precision = map.get("Precision");//地理位置经度
        this.msgID = map.get("MsgID");//消息id
        this.status = map.get("Status");//发送状态,用户拒绝接收(failed:user block),发送成功(success)

    }

    public String getFromUserName() {
        return fromUserName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    public String getToUserName() {
        return toUserName;
    }

    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getEventKey() {
        return eventKey;
    }

    public void setEventKey(String eventKey) {
        this.eventKey = eventKey;
    }

    public String getTicket() {
        return ticket;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getPrecision() {
        return precision;
    }

    public void setPrecision(String precision) {
        this.precision = precision;
    }

    public String getMsgID() {
        return msgID;
    }

    public void setMsgID(String msgID) {
        this.msgID = msgID;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
